home *** CD-ROM | disk | FTP | other *** search
/ Champak 141 / (Vol 141) Oct 17 2011.iso / Games / dodge.swf / scripts / __Packages / StraightEnemy.as < prev    next >
Encoding:
Text File  |  2011-10-17  |  1.6 KB  |  72 lines

  1. class StraightEnemy extends Enemy
  2. {
  3.    var mc;
  4.    var weaponType;
  5.    static var SCORE = 200;
  6.    static var SPEED = 5;
  7.    static var WAIT_TIME = 45;
  8.    static var ENEMY_TYPE = "enemy4";
  9.    static var MAX_HEALTH = 3;
  10.    static var COLOR = 16226057;
  11.    static var SHAPE_FLAG = false;
  12.    function StraightEnemy(x, y)
  13.    {
  14.       super(x,y);
  15.    }
  16.    function getScore()
  17.    {
  18.       return StraightEnemy.SCORE;
  19.    }
  20.    function getSpeed()
  21.    {
  22.       return StraightEnemy.SPEED;
  23.    }
  24.    function getEnemyType()
  25.    {
  26.       return StraightEnemy.ENEMY_TYPE;
  27.    }
  28.    function getWaitTime()
  29.    {
  30.       return StraightEnemy.WAIT_TIME;
  31.    }
  32.    function getMaxHealth()
  33.    {
  34.       return StraightEnemy.MAX_HEALTH;
  35.    }
  36.    function getColor()
  37.    {
  38.       return StraightEnemy.COLOR;
  39.    }
  40.    function getShapeFlag()
  41.    {
  42.       return StraightEnemy.SHAPE_FLAG;
  43.    }
  44.    function getWeaponsPoints()
  45.    {
  46.       var _loc3_ = new Array();
  47.       var _loc2_ = new flash.geom.Point(this.mc.weapon1._x,this.mc.weapon1._y);
  48.       this.mc.localToGlobal(_loc2_);
  49.       _loc3_.push(_loc2_);
  50.       _loc2_ = new flash.geom.Point(this.mc.weapon2._x,this.mc.weapon2._y);
  51.       this.mc.localToGlobal(_loc2_);
  52.       _loc3_.push(_loc2_);
  53.       return _loc3_;
  54.    }
  55.    function shootIfAble()
  56.    {
  57.       this.weaponType = Math.random();
  58.       super.shootIfAble();
  59.    }
  60.    function createNewMissile(x, y)
  61.    {
  62.       if(this.weaponType < 0.7)
  63.       {
  64.          new StraightMissile(x,y,this.mc._rotation);
  65.       }
  66.       else
  67.       {
  68.          new Missile(x,y,this.mc._rotation);
  69.       }
  70.    }
  71. }
  72.